<template>
  <div class="rank-content">
    <div class="title">支付榜TOP5</div>
    <el-table v-loading="loading" :data="tableDatas" style="width: 100%">
      <el-table-column type="index" label="排名" />
      <el-table-column label="课程名称">
        <template slot-scope="scope">
          <el-tooltip effect="dark" :content="scope.row.title" placement="bottom-start">
            <div class="course-title">{{ scope.row.title }}</div>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column prop="payment_user_count" label="支付人数" />
      <el-table-column :label="'结算金额(' + site.money_title + ')'">
        <template slot-scope="scope">
          <count-roll :number="scope.row.payment" :is-money="true" />
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import CountRoll from '@/pages/data/components/count_roll';
export default {
  components: {
    CountRoll
  },
  props: {
    tableDatas: {
      type: Array,
      default: () => {
        return [];
      }
    },
    loading: {
      type: Boolean,
      default: true
    }
  }
};
</script>

<style lang="scss" scoped>
.rank-content {
  border: 1px solid #dcdfe6;
  border-bottom: none;
  ::v-deep.el-table__header-wrapper th {
    background-color: #f6f9ff;
  }
  .title {
    font-size: 16px;
    color: #303133;
    text-align: center;
    padding: 22px 0;
  }
  .course-title {
    width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
</style>
